﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace ebc.componentbinder.tests
{
    [TestFixture]
    public class test_IsEbcMethod
    {
        [Test]
        public void Recognize_method()
        {
            var mi = typeof (OnlyRelevantEventhandlers).GetMethods().First();
            Assert.IsTrue(mi.IsEbcMethod());
        }

        [Test]
        public void Reject_irrelevant_methods()
        {
            var mi = typeof (SomeRelevantEventhandlers).GetMethod("TooManyParameters");
            Assert.IsFalse(mi.IsEbcMethod());
            mi = typeof(SomeRelevantEventhandlers).GetMethod("HasReturnValue");
            Assert.IsFalse(mi.IsEbcMethod());
            mi = typeof(SomeRelevantEventhandlers).GetMethod("NoParameters");
            Assert.IsFalse(mi.IsEbcMethod());
        }
    }
}
